//
//  UICodeInputView.swift
//  test-ios
//
//  Created by wyz5204 on 2023/3/13.
//

import UIKit

class UICodeInputView: UIAbstractView {
    
    lazy var codeTitle : UILabel  = {
        return UILabel().then { view in
            view.text = "验证码"
            view.font = UIFont.systemFont(ofSize: 14)
            view.textColor = UIColor.black_dark
        }
    }()
    
    lazy var codeField : UITextField = {
        return UITextField().then { view in
            view.setPlaceholder("请输入验证码")
            view.text = "a123456"
            view.keyboardType = .numberPad
            view.clearButtonMode = .whileEditing
            view.returnKeyType = .done
        }
    }()
    
    lazy var lineView : UILabel = {
        return UILabel().then { view in
            view.backgroundColor = UIColor.separatorLine
        }
    }()
    
    override func initView(_ frame: CGRect) {
        codeTitle.addTo(self) { view in
            view.snp.makeConstraints { (make) in
                make.bottom.equalToSuperview().offset(-10)
                make.left.equalToSuperview()
            }
        }
        codeField.addTo(self) { view in
            view.snp.makeConstraints { (make) in
                make.centerY.equalTo(codeTitle)
                make.left.equalToSuperview().offset(52)
                make.right.equalToSuperview()
            }
        }
        
        lineView.addTo(self) { view in
            view.snp.makeConstraints { (make) in
                make.left.right.bottom.equalToSuperview()
                make.height.equalTo(1)
            }
        }
    }
    
}
